<?php
/*
 *  add  *
 */
	echo "add.thtml\n";
	$agen = "";
	$agen .= pr("<?php");
	$agen .= pr("\techo \$accessibility->whereIAm(\$pageTitle);");
	$agen .= pr("\techo \"<h2 id='contentTitle'>\".\$pageTitle.\"</h2>\";");

	$agen .= pr("\techo \$form->create();");
	foreach ($addc as $c) {
		$query2 = "SELECT DATA_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name ='$table' AND column_name LIKE '".$c."';";
		$result = mysql_query($query2,$con);
		$row = mysql_fetch_array($result);
		$coluna_tipo = $row['DATA_TYPE'];

		if (substr($c,-3,3) == "_id") {
			$col_name = substr($c,0,strlen($c)-3);
			$col_name = ucfirst($col_name);
		} else {
			$col_name = ucfirst($c);
		}
		if (substr($c,-3,3) == "_id") {
			$agen .= pr("\techo \$form->label('".$c."');");
			$agen .= pr("\techo \$form->select('".$c."', \$".plural(substr($c,0,strlen($c)-3)).", null, array());");
		} else if ($coluna_tipo == "text") {
			$agen .= pr("\techo \$form->label('".$c."');");
			$agen .= pr("\techo \$form->textarea('".$c."').\"<br/>\";");
		} else {
			$agen .= pr("\techo \$form->input('".$c."');");
			
		}
	}
	$agen .= pr("\techo \"<br />\";");
	$agen .= pr("\techo \$form->end('Cadastrar ".$strUS."');");
	$agen .= pr("?>");
	echo $agen;

?>